<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *商品管理
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$shop=$this->pdo_get('shop',array('mid'=>$_SESSION['uid']));
	if(!$shop['share_ewm']){
		$url=custom_url('jy_friends_shop/myshop/main/mid='.$_SESSION['uid'],true);
		$url=cfc('tools')->createqrcode($url,'250',true);
		if($shop['id']){
			$this->pdo_update('shop',array('share_ewm'=>$url),array('id'=>$shop['id']));
		}else{
			$data=array(
				'share_ewm'=>$url,
				'mid'=>$_SESSION['uid'],
				'uniacid'=>$_SESSION['uniacid'],
			);
			$this->pdo_insert('shop',$data);
		}
	}else{
		$url=$shop['share_ewm'];
	}
	$return['share_ewm']=$url;
	exi($return);
}